Micron Document




Comment (computer programming)
part 27/37 · 66.0 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Nim delimits a line comment with # and block comments with #[ and ]#. Block comments can be nested.

Nim also has documentation comments that use mixed Markdown and ReStructuredText markups. A line documentation comment uses '##' and a block documentation comment uses '##[' and ']##'. The compiler can generate HTML, LaTeX and JSON documentation from the documentation comments. Documentation comments are part of the abstract syntax tree and can be extracted using macros.cite-ref-54[54]

## Documentation of the module *ReSTructuredText* and **MarkDown**
# This is a comment, but it is not a documentation comment.
type Kitten = object ## Documentation of type
age: int ## Documentation of field
proc purr(self: Kitten) =
## Documentation of function
echo "Purr Purr" # This is a comment, but it is not a documentation comment.
# This is a comment, but it is not a documentation comment.

OCaml

OCaml supports nestable comments. For example:

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────